package academic.concordia.bankofquebec.bean.utils;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;

public class BankAccountGenerator {
	
	public static String generateAccount(String prefix){
		String account = "";
		DateFormat df = new SimpleDateFormat("yyMMddHHmmss");
		Date currentDate = new Date();
		
		account = df.format(currentDate);
		
		//Adding prefix
		account = prefix + account;
		return account;
	}
	
	
	public static String generateCheckDigit(String account){
		String checkDigit = account.substring(15);
		return checkDigit;
	}

}
